test(e2e): harden Appium Test Dapp readiness for confirmations smokes (MMQA-2254) - #34577
test(e2e): harden Appium Test Dapp readiness for confirmations smokes (MMQA-2254)#34577chrisleewilcox wants to merge 13 commits into
Conversation
… (MMQA-2254) Wait for page chrome, provider injection, and enabled controls before tapping; prefer native Android WebView taps so CDP false-success clicks do not block CI. Co-authored-by: Cursor <cursoragent@cursor.com>
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
iOS WebView logo/title waits left the session in WEBVIEW, breaking native close-browser taps in network-manager2. Use native WebView + title text instead. Co-authored-by: Cursor <cursoragent@cursor.com>
… reset (MMQA-2254) iOS does not expose the Test Dapp title in the native tree. Keep WebView logo/title waits on iOS and always switch back to NATIVE_APP afterward. Co-authored-by: Cursor <cursoragent@cursor.com>
…QA-2254) After reload, fixture permissions can inject ethereum without globalConnectionChange, leaving action buttons disabled. Request accounts, emit the dapp connection event, then use trusted CDP clicks with native fallback so confirm sheets open reliably on Android Appium. Co-authored-by: Cursor <cursoragent@cursor.com>
…s (MMQA-2254)
Screenshots showed Create Token already clicked ("Creation Failed") while
CI re-tapped every 3s waiting for confirm-button. Wait 15s per tap for gas
estimation, nudge dapp UI gates without eth_requestAccounts, and emit
blockBaseFeePerGasUpdate so EIP-1559 send enables.
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #34577 +/- ##
==========================================
- Coverage 85.12% 85.11% -0.01%
==========================================
Files 6350 6369 +19
Lines 173080 173713 +633
Branches 42804 42977 +173
==========================================
+ Hits 147333 147864 +531
- Misses 15708 15771 +63
- Partials 10039 10078 +39 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…s (MMQA-2254) CI screenshots showed NOT CONNECTED / Account undefined after we dispatched globalConnectionChange — buttons enabled without src.provider. Click Connect so the dapp runs its real eth_requestAccounts handler, then wait for #accounts. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…MMQA-2254) CI showed Active Provider UUID/Name empty while eth_accounts still worked — Connect used unset globalContext.provider. Click "Use MetaMask" after the EIP-6963 button appears, then hydrate accounts via Connect as before. Co-authored-by: Cursor <cursoragent@cursor.com>
…2254) iOS evaluateInWebView cannot await async eth_accounts Promises, so the new hydration path timed out and broke previously-green iOS confirmations smokes. Keep EIP-6963 Active Provider + Connect hydration on Android only. Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve confirmations.flow.ts by keeping Android EIP-6963 hydration and 15s confirm waits with main's waitForTestDappButtonReady contract binding. Co-authored-by: Cursor <cursoragent@cursor.com>
…254) waitForTestDappButtonReady can location.reload() on ?contract= pages, which clears Active Provider and accounts. Re-hydrate and wait again before tapping so approve flows do not hit the EIP-6963 race on the same attempt. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Addressed Bugbot finding (hydration lost after contract reload) in c52a928: |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Performance Test Selection: |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 418aef7. Configure here.
| timeout: ANDROID_CONFIRM_SHEET_TIMEOUT_MS, | ||
| // Keep retries sparse so we do not stampede eth_sendTransaction. | ||
| interval: 2_000, | ||
| }, |
There was a problem hiding this comment.
Retry budget shorter than hydration
Medium Severity
Android confirm retries use a 60s executeWithRetry budget, but each attempt can spend up to 60s in ensureTestDappAccountsHydrated alone (30s active-provider wait plus 30s accounts wait) before the 20s button wait and 15s confirm wait. Slow hydration can exhaust the outer timeout with no remaining confirm retries, which undercuts the sparse re-tap design.
Additional Locations (2)
Triggered by project rule: MetaMask Mobile E2E Testing Guidelines
Reviewed by Cursor Bugbot for commit 418aef7. Configure here.
|





Description
appium-confirmations-android-smokewas consistently failing across unrelated PRs (shards 1 and 2), blocking merges.Root cause is Test Dapp readiness / Appium helper timing — not a product regression:
waitForTestDappToLoadwas too weak (URL bar only). Action buttons stay disabled until page JS + provider connection complete.initialize()checksproviderDetails.lengthbefore announce arrives). Active Provider UUID/Name stay blank, so Connect uses an unsetglobalContext.providerwhilewindow.ethereumstill answerseth_accounts.confirm-button, thrashing in-flighteth_sendTransaction(Test Dapp showed "Creation Failed").NATIVE_APPso later native taps (e.g. close browser) still work.This PR hardens the shared helpers used by confirmations Appium smokes:
#accountspreferNativeoption for Android WebView taps (unit-tested)Changelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/MMQA-2254
Related: https://consensyssoftware.atlassian.net/browse/MMQA-2232
Manual testing steps
CI validation on this PR (
4a43fc9718e):appium-confirmations-android-smoke1 & 2: passappium-confirmations-ios-smoke1 & 2: passLocal unit coverage:
Screenshots/Recordings
N/A — test/infra-only change; no product UI changes.
Before
N/A
After
N/A
Pre-merge author checklist
Performance checks (if applicable)
Pre-merge reviewer checklist
Note
Low Risk
Test-infra only: changes Appium E2E helpers and selectors with no product, auth, or data-path impact.
Overview
Stabilizes flaky Appium confirmations smokes by making Test Dapp readiness waits match real interactivity, not just URL-bar presence.
waitForTestDappToLoadnow waits for page chrome on Appium (Android native title/WebView; iOS logo/title) and always resets to native context on iOS so later native taps keep working.Confirmation taps hydrate the provider before acting: Android selects EIP-6963 Active Provider, Connects if needed, waits for
#accounts/enabled buttons (re-hydrating after contract reload), then uses a longer 15s post-tap confirm wait with sparse retries. iOS waits for provider readiness and an enabled control. Adds a unit-testedpreferNativeWebView tap option so retries can skip false-success CDP clicks.Reviewed by Cursor Bugbot for commit 418aef7. Bugbot is set up for automated code reviews on this repo. Configure here.